from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
import time

testCase = "DBshop020_商品管理商品属性"
#登录后台
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
# 1.点击“删除”按钮，确定删除，删除成功。
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性')

s=firefox.find_element_by_xpath('//body/div[2]/div/div[2]/form/table/tbody/tr/td[2]').text
print(s)

firefox.find_elements_by_link_text('删除')[0].click()
time.sleep(2)
alert=firefox.switch_to_alert()
alert.accept()

ss=firefox.find_element_by_xpath('//body').text
if s in ss:
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试不通过" % testCase)
    getPhoto(firefox)
firefox.quit()